package cn.yllr.tomgxianghui.dao;

import cn.yllr.tomgxianghui.domain.Order;
import cn.yllr.tomgxianghui.entity.User;
import cn.yllr.tomgxianghui.model.PartOrderDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface OrderMapper {
    Boolean addorders(@Param("account") String cid,
                      @Param("orderid") String oid,
                      @Param("creationtime") String date,
                      @Param("paymentstatus") Integer paymentstatus,
                      @Param("address") String address,
                      @Param("price") Integer price,
                      @Param("orderStatus") Integer orderStatus);

    List<Order> findorders();

    int updateOrderStstus(Order order);

    Order findorderbycid(@Param("orderid") String oid);
    int deleteorders(@Param("orderid") String id);
    int insertOrdlist(List<PartOrderDetail> lists);
    List<PartOrderDetail> findDetail_order(String orderid);
    User findphoneByid(@Param("account") String name);
    int cancelOrderbyid(@Param("orderid") String orderid);
    List<Order> findOrderbycookid(@Param("account") String cid);
    int agreeupdateOrder(String orderid);
    int refuseupdateOrder(String orderid);
    int updatestatusForpay(String orderid);
}
